﻿@using QDT.Common.Plugins
@using InputType = QDT.Common.InputType
@model QDT.Common.Plugins.IPayment
           
<div class="main_title">安装 
    @Html.ActionLink("返回列表", "Index", "Payment", new {
        @class = "back_list"
    })
</div>
<div class="blank5"></div>
@using (Html.BeginForm("PostInstall", "Payment", FormMethod.Post)) {
    <table class="form" cellpadding="0" cellspacing="0">
        <tbody><tr>
                   <td colspan="2" class="topTd"></td>
               </tr>
            <tr>
                <td class="item_title">支付接口名称:</td>
                <td class="item_input">
                    @Model.Name
                </td>
            </tr>
            <tr>
                <td class="item_title">接口类名:</td>
                <td class="item_input">
                    @Model.GetType().Name<input type="hidden" value="@Model.GetType().Name" name="ClassName">
                </td>
            </tr>
            <tr>
                <td class="item_title">状态:</td>
                <td class="item_input">
                    <lable>有效<input type="radio" name="IsEffect" value="true" checked="checked"></lable>
                    <lable>无效<input type="radio" name="IsEffect" value="false"></lable>
                </td>
            </tr>
            <tr>
                <td class="item_title">手续费:</td>
                <td class="item_input">
                    <select name="FeeType">
                        <option value="0">定额</option>
                        <option value="1">比率</option>
                    </select>
                    <input type="text" class="textbox" name="FeeAmount" value="">
                    <span class="tip_span">选择比率时,请填写可以与付款总价相乘的倍率,如0.06, 收取6%手续费</span>
                </td>
            </tr>
            <tr>
                <td class="item_title">LOGO:</td>
                <td class="item_input">
                    @Html.UploadImage("Logo")
                </td>
            </tr>	<tr>
                        <td class="item_title">排序:</td>
                        <td class="item_input">
                            <input type="text" class="textbox" name="Sort" value="@Model.Sort">
                        </td>
                    </tr>
            <tr>
                <td class="item_title">描述:</td>
                <td class="item_input">
                    <textarea class="textarea" name="Description"></textarea>
                </td>
            </tr>	
            @if (Model.Config != null) {
                <tr>
                    <td class="item_title">接口配置:</td>
                    <td class="item_input" id="J_OtherPayCfg">
                    @foreach (var c in Model.Config) {
                        <span class="cfg_title">@c.Value.Title:</span>
                        <span class="cfg_content">
                            @if (c.Value.InputType == InputType.Text) {
                                <input type="text" name="Config[@c.Key]" value=""/>
                            }
                            @if(c.Value.InputType==InputType.Password) {
                                <input type="password" name="Config[@c.Key]" value=""/>
                            }
                            @if (c.Value.InputType == InputType.Select) {
                                foreach (var s in (CheckBoxGroup)c.Value.Values)
                                {
                                    <label>
                                        <input type="checkbox" name="Config[@c.Key]" value="@s.Key">@s.Value.Value
                                    </label>
                                    <br/>
                                }
                            }
                        </span>
                        <div class="blank5"></div>
                    }
                </tr>
            }

            <tr>
                <td class="item_title"></td>
                <td class="item_input">
                    <!--隐藏元素-->
                    <input type="hidden" value="1" name="online_pay">
                    <input type="hidden" name="m" value="Payment">
                    <input type="hidden" name="a" value="insert">
                    <!--隐藏元素-->
                    <input type="submit" class="button" value="新增">
                    <input type="reset" class="button" value="重置">
                </td>
            </tr>
            <tr>
                <td colspan="2" class="bottomTd"></td>
            </tr>
        </tbody ></table>
}
